home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Source / Sieve / SIEVEMFC / SIEVEMFC.CPP < prev    next >
C/C++ Source or Header  |  1995-09-30  |  2KB  |  71 lines

  1. // SieveMFC.cpp : Defines the initialization routines for the DLL.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "SieveMFC.h"
  6.  
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12.  
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CSieveMFCApp
  15.  
  16. BEGIN_MESSAGE_MAP(CSieveMFCApp, CWinApp)
  17.     //{{AFX_MSG_MAP(CSieveMFCApp)
  18.         // NOTE - the ClassWizard will add and remove mapping macros here.
  19.         //    DO NOT EDIT what you see in these blocks of generated code!
  20.     //}}AFX_MSG_MAP
  21. END_MESSAGE_MAP()
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CSieveMFCApp construction
  25.  
  26. CSieveMFCApp::CSieveMFCApp()
  27. {
  28.     // TODO: add construction code here,
  29.     // Place all significant initialization in InitInstance
  30. }
  31.  
  32. /////////////////////////////////////////////////////////////////////////////
  33. // The one and only CSieveMFCApp object
  34.  
  35. CSieveMFCApp theApp;
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CSieveMFCApp initialization
  39.  
  40. BOOL CSieveMFCApp::InitInstance()
  41. {
  42.     // Register all OLE server (factories) as running.  This enables the
  43.     //  OLE libraries to create objects from other applications.
  44.     COleObjectFactory::RegisterAll();
  45.  
  46.     return TRUE;
  47. }
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // Special entry points required for inproc servers
  51.  
  52. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  53. {
  54.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  55.     return AfxDllGetClassObject(rclsid, riid, ppv);
  56. }
  57.  
  58. STDAPI DllCanUnloadNow(void)
  59. {
  60.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  61.     return AfxDllCanUnloadNow();
  62. }
  63.  
  64. // by exporting DllRegisterServer, you can use regsvr.exe
  65. STDAPI DllRegisterServer(void)
  66. {
  67.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  68.     COleObjectFactory::UpdateRegistryAll();
  69.     return S_OK;
  70. }
  71.